package com.mida.app.report.controller;

import com.mida.app.report.service.DocSupportAreaService;
import com.mida.bms.report.vo.DocStructRequestVo;
import com.mida.bms.report.vo.PatientInfoParameterVo;
import com.mida.tool.common.cons.RespConst;
import com.mida.tool.common.exception.MassertException;
import com.mida.tool.common.result.ListResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 佐证区
 */
@RestController
@RequestMapping("/docSupportArea")
@CrossOrigin
@Slf4j
public class DocSupportAreaController {

    @Autowired
    private DocSupportAreaService docSupportAreaService;

    /**
     *  获取检查报告报告相关详情
     *
     * @param
     * @return
     */
    @PostMapping(value = "/getDocSupportContentList", produces = {"application/json;charset=UTF-8"})
    @ResponseBody
    public ListResult<List<DocStructRequestVo>> getDocSupportContentList(
            @RequestBody PatientInfoParameterVo vo) {
        try {
            // 根据人标识以及 检查类型查询相关检查详情列表
            return docSupportAreaService.getDocSupportContentList(vo);
        } catch (Exception ex) {
            log.error(ex.getMessage(), ex);
            throw new MassertException(
                    RespConst.newMsgError("获取检查报告报告相关详情异常,请联系管理员"));
        }
    }
}
